package com.rz.htk.destination.controller;

import com.rz.core.kit.RespKit;
import com.rz.core.resp.ResultResp;
import com.rz.htk.destination.entity.Destination;
import com.rz.htk.destination.service.IDestinationService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName DestinationController
 * @Description 目的港controller
 * @Author maweiyue
 * @Date 2019/9/6 13:37
 */
@RestController
@RequestMapping("/destination")
public class DestinationController {

    @Resource
    private IDestinationService destinationService;

    @PostMapping("/getPage")
    public ResultResp getPage(@RequestBody Destination destination){
        return RespKit.success(destinationService.getPage(destination));
    }

    @PostMapping("/saveDestination")
    public ResultResp saveDestination(@RequestBody Destination destination){
        return RespKit.success(destinationService.saveDestination(destination));
    }

    @PostMapping("/batchDelete/{id}")
    public ResultResp batchDelete(@PathVariable Integer id){
        return RespKit.success(destinationService.batchDelete(id));
    }

}
